import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
var state = {
  globalIp: 'http://wztest.wofew.com',
  aftersaleData: {},
  productData: {},
  useInfo: {},
  weChat: ''
}
var getters = {
  aftersale(state) {
    return state.aftersaleData
  },
  product(state) {
    return state.productData
  },
  useinfo(state) {
    return state.useInfo
  },
  wechat(state) {
    return state.weChat
  },
}
var mutations = {
  setAftersalet(state, payload) {
    state.aftersaleData = payload
  },
  setProduct(state, payload) {
    state.productData = payload
  },
  setUserinfo(state, payload) {
    state.useInfo = payload
  },
  loginstatus(state, payload) {
    state.weChat = payload
  }
}


const store = new Vuex.Store({
  state,
  getters,
  mutations
})

export default store
